package list_;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * @author wly
 * @version V1.0.0
 * @date 2023/1/10 15:35
 */
public class LinkedList02 {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.add(1);
        linkedList.add(2);
        linkedList.add(3);
        System.out.println(linkedList);
        linkedList.remove();
        System.out.println(linkedList);
        linkedList.set(1, 567);
        System.out.println(linkedList);

        Iterator iterator = linkedList.iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }

        for (Object o : linkedList) {
            System.out.println(o);
        }

    }
}
